<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/4/19
 * Time: 11:05
 */

namespace app\server;
use rap\db\DB;
use rap\db\Record;

class StickUser extends Record
{
    public function insertUserInfo($data) {

        $res = DB::insert('mp_stick_user',$data);

        return $res;
    }

    public function getUserList ($where, $field, $page = 0, $order) {
        $limit = 10;

        $list = DB::select('mp_stick_user')
            ->limit($limit * $page, $limit)
            ->where($where)
            ->fields($field)
            ->order($order)
            ->findAll();

        return $list;
    }

    public function getStickUserInfo ($where, $field) {

        $data = DB::select('mp_stick_user')->where($where)->fields($field)->find();

        return $data;
    }

    public function updateUserInfo ($where,$data) {

        $sql = DB::update('mp_stick_user');
        foreach ($data as $k => $v) {
            $sql = $sql->set($k, $v);
        }
        $res =$sql->where($where)->excuse();

        return $res;
    }

    public function updatePicCount ($sql) {

        $data = DB::query($sql);
    }
}